package com.zero.service.impl;

import com.zero.entity.HotSearch;
import com.zero.repository.HotSearchRepository;
import com.zero.service.HotSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：某人的目光
 * @date ： 2019/3/3 1:23
 * @description：${description}
 * @modified By：
 * @version: $version$
 */
@Service("hotSearchService")
public class HotSearchServiceImpl implements HotSearchService {

    @Autowired
    private HotSearchRepository hotSearchRepository;


    @Override
    public List<HotSearch> listAll(Sort.Direction direction, String... properties) {
        return hotSearchRepository.findAll(new Sort(direction, properties));
    }
}
